package 数组;

//public class arr
//{
//    public static void main(String[] args)
//    {
//        randomcall();
//
//    }
//    public static void randomcall()
//    {
//        String names[] = {"张三", "李四", "王五", "赵六", "孙七", "周八", "吴九", "郑十"};
//        int index = (int)(Math.random()*names.length);
//        String name = names[index];
//        System.out.println(name);
//
//    }
//
//
//}

import java.util.Scanner;

public class arr
{
    public static void main(String[] args)
    {
        //randomcall();
        inputScores();
    }
//        public static void randomcall ()
//        {
//            String names[] = {"张三", "李四", "王五", "赵六", "孙七", "周八", "吴九", "郑十"};
//            int index = (int) (Math.random() * names.length);
//            String tmp = names[index];
//            System.out.println(tmp);
//        }


        public static void inputScores()
        {
            double scores[] = new double[5];
            Scanner sc = new Scanner(System.in);
            int i = 0;
            for (i = 0; i < scores.length; i++) {
                System.out.println("请输入第" + (i + 1) + "个同学的成绩");
                scores[i] = sc.nextDouble();

            }
            double sum = scores[0];
            double max = scores[0];
            double min = scores[0];
            for (i = 1; i < scores.length; i++) {
                sum += scores[i];
                    if(scores[i]>max)
                    {
                        max = scores[i];
                    }
                    if(scores[i]<min)
                    {
                        min = scores[i];
                    }

            }
            System.out.println("总分是："+sum);
            double avg = sum / scores.length;
            System.out.println(avg);
            System.out.println("最高分是："+max);
            System.out.println("最低分是："+min);



        }
    }
